package com.tisson.database;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBConnection {
	
	private static DBConnection instance = null;
	private static Connection connection = null;
	
	private DBConnection(){
		try{
			Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
			String url = "jdbc:odbc:database";
			DBConnection.connection = DriverManager.getConnection(url, "sa", "dljk");
		}
		catch(Exception e){
			e.printStackTrace();
		}
	}
	
	public static DBConnection getInstance(){
		if(instance==null){
			instance = new DBConnection();
		}
		return instance;
	}

	public static Connection getConnection() {
		return connection;
	}
	
}
